/**
 * @file
 * @brief Collection of several utilities and helpers used in logging framework.
 */

#ifndef LOG_UTILITY_H
#define LOG_UTILITY_H

#include "nosal/log/common.h"
#include <string>

namespace netaos {
namespace nosal {
namespace log {
namespace internal {

inline std::string to_string(LogLevel level)
{
    switch (level) {
    case LogLevel::kOff:
        return {"Off"};
    case LogLevel::kFatal:
        return {"Fatal"};
    case LogLevel::kError:
        return {"Error"};
    case LogLevel::kWarn:
        return {"Warn"};
    case LogLevel::kInfo:
        return {"Info"};
    case LogLevel::kDebug:
        return {"Debug"};
    case LogLevel::kVerbose:
        return {"Verbose"};
    default:
        break;
    }

    return std::to_string(static_cast<unsigned>(internal::to_integral(level)));
}

}  // namespace internal
}  // namespace log
}  // namespace nosal
}  // namespace netaos

#endif  // LOG_UTILITY_H
